package moe.kotake.webbehw.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import moe.kotake.webbehw.entity.user;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
import java.util.Optional;
@Resource
public interface userMapper extends BaseMapper<user>{
    user selectById(Serializable id);
    @Select("select * from user where email = #{email}")
    Optional<user> selectAllByEmail(@Param(value = "email") String email);
    @Select("select * from user where email = #{email} and password = #{password}")
    Optional<user> selectAllByEmailAndPassword(@Param(value = "email") String email,@Param(value = "password") String password);
}
